﻿@model orienta.ViewModels.SolicitudPaso
@{
    Layout = "~/Views/Shared/BandejaLayout.cshtml";
    ViewBag.Title = "Bandeja";
    var fechaInicio = Request.Form["fechaInicio"];
    var fechaFin = Request.Form["fechaFin"];
    int i = 0;
    String colspan = "";
    String tipo = Request["tipo"];
    if (fechaInicio == null)
    {
        fechaInicio = String.Format("{0:dd/MM/yyyy}", DateTime.Now);
    }
    if (fechaFin == null)
    {
        fechaFin = String.Format("{0:dd/MM/yyyy}", DateTime.Now);
    }
}
<script src="@Url.Content("~/js/midis.js")"   type="text/javascript" ></script>
<script src="@Url.Content("~/js/bandeja.js")"   type="text/javascript" ></script>
<script src="@Url.Content("~/js/funciones.js")"   type="text/javascript" ></script>
<script src="@Url.Content("~/js/ajax.js")"   type="text/javascript" ></script>
<script src="@Url.Content("~/Scripts/layout/jquery-1.8.0.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery-ui.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/additional-methods.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/js/wick.js")" type="text/javascript" ></script>
<link href="@Url.Content("~/css/wick.css")" rel="stylesheet" type="text/css" />
<script type="text/javascript">
    var dataDependencia;
    var dataTipoDocumento;
</script>
<script type="text/javascript">
    window.onload = function () {
        cargarAutoComplete("0", "dataDependencia", "D");
        cargarAutoComplete("21", "dataTipoDocumento", "C");
        $("#fechaInicio").datepicker({ dateFormat: 'dd/mm/yy' });
        $("#fechaFin").datepicker({ dateFormat: 'dd/mm/yy' });
        inicioModal();
    }
</script>
<style>
    .dgNav a
    {
        font-size: 16px;
        cursor: hand;
        font-weight: bold;
        border: 1px solid #444;
        padding: 0 7px 3px 7px;
        margin: 0 4px 0 4px;
        color: #555;
        visibility: hidden;
        text-decoration: none;
        cursor: default !important;
    }
    .dgNav .lastPage, .dgNav .firstPage
    {
        padding: 0 6px 3px 6px;
        margin: 0;
    }
    .dgNav a.show
    {
        background: #778CCA;
        color: #eee;
        visibility: visible;
        cursor: pointer !important;
    }
    .dgNav a.show:hover
    {
        background: #3D6AA0;
        border: 1px solid #eee;
        color: #eee;
    }
    .dgNav a.lastPage:hover, .dgNav a.firstPage:hover
    {
        background: #3D6AA0;
    }
    .dgNav a.show:active
    {
        background: #eee !important;
        color: #333 !important;
    }
</style>
<div style="width: 100%; height: 100%; ">
    <input type="hidden" id="dependencia" value="@User.Identity.Name.Split('@')[2]">
    <input type="hidden" id="tipo" name="tipo" value="@Request["tipo"]"/>
    <table cellpadding="0" border="0" cellspacing="0" style="width: 100%; height: 100%;" class="tablaInterna_MIDIS">
        <tr>
            <td valign="top">
                @using (Html.BeginForm())
                {

                        <table cellpadding="2" border="0" cellspacing="0" width="100%">
                            <tr>
                                <td id="divSearch" style="width: 150px;" valign="top">
                                    <div style="width: 120px;">
                                        <table cellpadding="0" border="0" cellspacing="0" width="40%">
                                            <tr>
                                                <td align="left">
                                                    <img src="@Url.Content("~/images/orienta.png")" height="70px" height="135px"  alt="MOSTRAR FAVORITOS"  />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    &nbsp;
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <table cellpadding="1" border="0" cellspacing="1" width="100%">
                                                        <tr class="tituloBlanco_MIDIS">
                                                            <td colspan="2" align="left">
                                                                FAVORITOS
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                &nbsp;
                                                            </td>
                                                            <td>
                                                                <input type="button" style="width: 145px;" class="boton"
                                                                    value="Bandeja de Entrada" onclick="javascript:ver('');" />

                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                &nbsp;
                                                            </td>
                                                            <td>
                                                                <input type="button" style="width: 145px;" class="boton"
                                                                    value="Bandeja de Salida" onclick="javascript:ver('S');" />
                                                            </td>
                                                        </tr>
                                                         <tr>
                                                            <td>
                                                                &nbsp;
                                                            </td>
                                                            <td>
                                                                <input type="button" style="width: 145px;" class="boton"
                                                                    value="Bandeja temporal" onclick="javascript:ver('T');" />
                                                            </td>
                                                        </tr>
                                                        
                                                    </table>
                                                </td>
                                            </tr>
                                        </table>
                                    </div>
                                </td>
                                <td style="width: 5px;border-left:blue;border-left-width:thin">
                                    <div id="divImgOculta">
                                        <img src="@Url.Content("images/page-first.gif")" alt="MOSTRAR FAVORITOS" class="lupita2_MIDIS" onclick="javascript:mostrarDivSearch(this,'1');" /></div>
                                </td>
                                <td valign="top">
                                    <table xclass="tablaDetalle" cellpadding="0" border="0" cellspacing="0" width="100%">
                                        <tbody class="textNormal8">
                                            <tr>
                                                <td><br/>
                                                    <table cellpadding="0" cellspacing="0" border="0" width="100%">
                                                        <tbody class="tituloBlanco_MIDIS">
                                                            <tr>
                                                                <td>
                                                                    <table cellpadding="0" cellspacing="0" border="0" class="tituloTextNormal">
                                                                        <tr style="color:#FFF">
                                                                            <td >
                                                                                <span><b><em>
                                                                                @if (Request["tipo"] == "S")
                                                                                {
                                                                                    @:BANDEJA DE SALIDA 
                                                                                }
                                                                                else
                                                                                {
                                                                                    if (Request["tipo"] == "T")
                                                                                    {
                                                                                    
                                                                                        @:BANDEJA TEMPORAL
                                                                                    }
                                                                                    else
                                                                                    {
                                                                                    @:BANDEJA DE ENTRADA
                                                                                    }
                                                                                }
                                                                                </em></b></span>
                                                                            </td>
                                                                            <td>
                                                                                :
                                                                            </td>
                                                                            <td>@Html.DropDownList("bandeja", (IEnumerable<SelectListItem>)ViewBag.bandeja, new { onchange = "javascript:filtrar()" })
                                                                            </td>
                                                                        </tr>
                                                                    </table>
                                                                </td>
                                                                <td align="right">
                                                                 @if (!"S".Equals(Request["tipo"]))
                                                                 {
                                                                    <table cellpadding="0" cellspacing="0" border="0" xwidth="70%">
                                                                        <tr>
                                                                            @if (!"T".Equals(Request["tipo"]))
                                                                            {
                                                                            <td>
                                                                                <input type="button" name="btnTemporal" id="btnTemporal" style="width: 130px;" class="boton"
                                                                                    value="Archivo Temporal" onclick="javascript:paraArchivar('T');" />
                                                                            </td>
                                                                            }
                                                                            <td>
                                                                                &nbsp;
                                                                            </td>
                                                                            <td>
                                                                                <input type="button" name="btnFinal" id="btnFinal" style="width: 100px;" class="boton"
                                                                                    value="Archivo Final" onclick="javascript:paraArchivar('F');" />
                                                                            </td>
                                                                            @if (!"T".Equals(Request["tipo"]))
                                                                            {
                                                                            <td>
                                                                                &nbsp;
                                                                            </td>
                                                                            <td>
                                                                                <input type="button" name="btnRecepcion" id="btnRecepcion" style="width: 100px;" class="boton"
                                                                                    value="Recepcionar" onclick="javascript:recepcionarFisica(this);" />
                                                                            </td>
                                                                            }
                                                                        </tr>
                                                                    </table>
                                                                 }
                                                                </td>
                                                            </tr>
                                                        </tbody>
                                                    </table>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <table width="100%" cellpadding="0" border="0" cellspacing="0">
                                                        <tr>
                                                            <td>
                                                                <table width="900px" border="0" cellpadding="5" cellspacing="0" class="tablaInterna_MIDIS">
                                                                    <tbody class="tituloTextNormal">
                                                                        <tr>
                                                                            <td>
                                                                                <table cellpadding="0" cellspacing="0" border="0" class="tituloTextNormal">
                                                                                    <tr>
                                                                                        <td>
                                                                                            <table cellpadding="0" cellspacing="0" border="0" class="tituloTextNormal">
                                                                                                <tr>
                                                                                                    <td>
                                                                                                        Ver
                                                                                                    </td>
                                                                                                    <td>
                                                                                                        :
                                                                                                    </td>
                                                                                                    <td>
                                                                                                        <select name="nroTramites" id="nroTramites" onchange="javascript:filtrar()">
                                                                                                            <option value="15">15</option>
                                                                                                            <option value="30">30</option>
                                                                                                            <option value="50">50</option>
                                                                                                            <option value="100">100</option>
                                                                                                        </select>
                                                                                                    </td>
                                                                                                    <td>
                                                                                                        &nbsp;
                                                                                                    </td>
                                                                                                    <td>
                                                                                                        Tr&aacute;mites
                                                                                                    </td>
                                                                                                </tr>
                                                                                            </table>
                                                                                        </td>
                                                                                        <td style="width: 50px;">
                                                                                            &nbsp;
                                                                                        </td>
                                                                                        <td>
                                                                                            Fecha inicio
                                                                                        </td>
                                                                                        <td>
                                                                                            :
                                                                                        </td>
                                                                                        <td>
                                                                                            <table border="0" cellpadding="0" cellspacing="0">
                                                                                                <tbody>
                                                                                                    <tr>
                                                                                                        <td>
                                                                                                            @Html.TextBox("fechaInicio", fechaInicio, new { style = "width: 60px;", maxlength = "10", onkeyup = "javascript:MiFechaNew(this);", onkeypress = "javascript:ValidaCaracteres();", ondblclick = "javascript:limpiaCaja(this);" })
                                                                                                        </td>
                                                                                                        <td>
                                                                                                        </td>
                                                                                                    </tr>
                                                                                                </tbody>
                                                                                            </table>
                                                                                        </td>
                                                                                        <td>
                                                                                            &nbsp;
                                                                                        </td>
                                                                                        <td>
                                                                                            Fecha fin
                                                                                        </td>
                                                                                        <td>
                                                                                            :
                                                                                        </td>
                                                                                        <td>
                                                                                            <table border="0" cellpadding="0" cellspacing="0">
                                                                                                <tbody>
                                                                                                    <tr>
                                                                                                        <td>
                                                                                                            @Html.TextBox("fechaFin", fechaFin, new { style = "width: 60px;", maxlength = "10", @class = "cajaTextoMayuscula", onkeyup = "javascript:MiFechaNew(this);", onkeypress = "javascript:ValidaCaracteres();", ondblclick = "javascript:limpiaCaja(this);" })
                                                                                                        </td>
                                                                                                        <td>
                                                                                                        </td>
                                                                                                    </tr>
                                                                                                </tbody>
                                                                                            </table>
                                                                                        </td>
                                                                                        <td>
                                                                                            &nbsp;
                                                                                        </td>
                                                                                        <td>
                                                                                            <input type="button" name="btnFiltrar" id="btnFiltrar" style="width: 60px;" class="boton"
                                                                                                value="Filtrar" onclick="javascript:filtrar();" />
                                                                                        </td>
                                                                                    </tr>
                                                                                </table>
                                                                            </td>
                                                                            <td align="right">
                                                                                <table cellpadding="0" cellspacing="0" border="0">
                                                                                    <tr>
                                                                                        <td>
                                                                                            @Html.DropDownList("nIdeClaseSolicitud", (IEnumerable<SelectListItem>)ViewBag.claseSolicitud, new { @class = "select8_MIDIS" })
                                                                                        </td>
                                                                                        <td>
                                                                                            :
                                                                                        </td>
                                                                                        <td>
                                                                                            <input type="text" name="nIdeDep" id="nIdeDep" style="width: 28px;" value="@User.Identity.Name.Split('@')[2]" maxlength="4"
                                                                                            class="cajaTextoMayuscula" onkeypress="javascript:ValidaCaracteres();" />
                                                                                        </td>
                                                                                        <td>
                                                                                            -
                                                                                        </td>
                                                                                        <td>
                                                                                             <input type="text" name="nAnnSolicitud" id="nAnnSolicitud" style="width: 28px;" value="@DateTime.Now.Year.ToString()"
                                                                                            maxlength="4" class="cajaTextoMayuscula" onkeypress="javascript:ValidaCaracteres();" />
                                                                                        </td>
                                                                                        <td>
                                                                                            -
                                                                                        </td>
                                                                                        <td>
                                                                                            
                                                                                        <input type="text" name="nNumCorrelativo" id="nNumCorrelativo" style="width: 35px;"
                                                                                            value="" maxlength="4" class="cajaTextoMayuscula" onkeypress="javascript:ValidaCaracteres();" />
                                                                                        </td>
                                                                                        <td>
                                                                                            &nbsp;
                                                                                        </td>
                                                                                        <td>
                                                                                            <input type="button" name="btnBuscar" id="btnBuscar" style="width: 43px;" class="boton"
                                                                                                value="Buscar" onclick="javascript:buscarPorNumeroSolicitud();" />
                                                                                        </td>
                                                                                    </tr>
                                                                                </table>
                                                                            </td>
                                                                        </tr>
                                                                    </tbody>
                                                                </table>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                   <input type="hidden" name="seqActor" id="seqActor"/>
                                                   <input type="hidden" name="seqPaso" id="seqPaso"/>
                                                </td>
                                            </tr>

                                            <tr>
                                                <td><div id="procesando"></div>
                                                    <div id="divDetalleBandeja2" style="overflow: auto; width: 100%; height: 100%;">



                                                    @if (Model.listaBandeja != null && Model.listaBandeja.Count > 0)
                                                    {
                                                        if ("S".Equals(Request["tipo"]))
                                                        {
                                                            colspan = "10";
                                                        }
                                                        else
                                                        {
                                                            colspan = "11";
                                                        }
                                                    <table cellpadding="0" border="1" cellspacing="0" width="100%" class="tablaPrincipalSin">
    <tbody>
                                                        <tr style="background-color:#FFF" BORDER="0" >
		                                                <td class="col2" colspan="@colspan"  height="25px">
			                                            <div id="navHolder">
<span class="dgNav">
@if (1 != ViewBag.nroPagina)
{
    <a title="Pagina Anterior" href="#" onclick="javascript:filtrar('A','@ViewBag.nroPagina')" class="prevPage show">‹‹</a>
}
<span class="textNormal8">
@ViewBag.desde - @ViewBag.hasta  de @ViewBag.nroTotalRegistros
</span>

@if (ViewBag.nroTotalRegistros != ViewBag.hasta)
{
    <a title="Siguiente Pagina" href="#" onclick="javascript:filtrar('S','@ViewBag.nroPagina')" class="nextPage show">»</a>
}
</span>
</div>
			
		</td>
		</tr>
                                                            <tr class="tituloTablaDetalle" style="font-size:9pt">
                                                                <td>#</td>
                                                                 @if (!"S".Equals(tipo))
                                                                 { 
                                                                     <td>Estado</td>
                                                                 }
                                                                <td>Número solicitud</td>
                                                                <td>Solicitante/Afectado</td>
                                                                <td>Programa</td>
                                                                <td>Tipo de Solicitud</td>
                                                                <td>Motivo Solicitud</td>
                                                                <td>Para</td>
                                                                <td>Fecha Recepci&oacuten</td>
                                                                <td>Fecha Recep. Fís.</td>
                                                                @if (!"S".Equals(Request["tipo"]))
                                                                {
                                                                    <td>Sel.</td>
                                                                }
                                                                
                                                                
                                                            </tr>
                                                            @foreach (var item in Model.listaBandeja)
                                                            {
                                                                String cadena = item.clase.Substring(0, 3);
                                                                String a = String.Format("{0:000}", item.nIdeDep);
                                                                String negrita = "bold";
                                                                String color = "";
                                                                String tootip = "";
                                                                if (!"S".Equals(tipo))
                                                                {
                                                                    DateTime d1 = DateTime.Now;
                                                                    TimeSpan t = d1 - item.fechaEntrada.Value;
                                                                    double NrOfDays = t.TotalDays;
                                                                    decimal plazo = item.plazo;
                                                                    decimal diasParaCumplirPlazo = plazo - (decimal)NrOfDays;

                                                                    if (diasParaCumplirPlazo <= 0)
                                                                    {
                                                                        color = "red";
                                                                        tootip = -1 * diasParaCumplirPlazo + " dias de atraso";
                                                                    }
                                                                    else
                                                                    {
                                                                        if (diasParaCumplirPlazo > 1 && diasParaCumplirPlazo < 2)
                                                                        {
                                                                            color = "yellow";
                                                                            tootip = (int)diasParaCumplirPlazo + " dias de plazo";
                                                                        }
                                                                        else
                                                                        {
                                                                            color = "green";
                                                                            tootip = (int)diasParaCumplirPlazo + " dias de plazo";
                                                                        }
                                                                    }
                                                                }
                                                                if (item.fechaLectura != null)
                                                                {
                                                                    negrita = "normal";
                                                                }
                                                                i = ViewBag.desde + i;

                                                            <tr style="background-color:#D6DEEC;font-weight:@negrita;text-transform:uppercase" class="textNormal8">
                                                                <td>@i</td>
                                                                 @if (!"S".Equals(tipo))
                                                                 {
                                                                <td style="background:@color" title="@tootip">
                                                                    &nbsp;
                                                                </td>
                                                                 }
                                                                <td align="left"><a id='aLink-@item.nIdeSolicitud' href="javascript:verSolicitud('@String.Format("{0:0.#}", item.nIdeSolicitud)','@String.Format("{0:0.#}", item.nSeqPaso)','@String.Format("{0:0.#}", item.nSeqActor)')">
                                                                    @String.Format("{0:000}", item.nIdeDep)-@String.Format("{0:0000}", item.nAnnSolicitud)-@cadena-@String.Format("{0:000000}", item.nNumSolicitud)
                                                                    </a>
                                                                </td>
                                                                <td align="left">DNI:@Html.DisplayFor(modelItem => item.solicitante)<br/>DNI:@Html.DisplayFor(modelItem => item.afectado)</td>
                                                                <td>@Html.DisplayFor(modelItem => item.programa)</td>
                                                                <td align="left">@Html.DisplayFor(modelItem => item.clase)</td>
                                                                <td align="left">@Html.DisplayFor(modelItem => item.tipo)</td>
                                                                <td align="left">@Html.DisplayFor(modelItem => item.estado)</td>
                                                                <td>@String.Format("{0:dd/MM/yyyy HH:mm}", item.fechaEntrada)</td>
                                                                <td>@String.Format("{0:dd/MM/yyyy HH:mm}", item.fechaRecepcion)</td>
                                                                @if (!"S".Equals(Request["tipo"]))
                                                                {
                                                                <td><input type="checkbox" id="seleccionado[]" name="seleccionado[]" value="@String.Format("{0:0.#}", item.nIdeSolicitud),@String.Format("{0:0.#}", item.nSeqPaso),@String.Format("{0:0.#}", item.nSeqActor)"/></td>
                                                                }
                                                            </tr>
                                                            }
                                                        </tbody>
                                                    </table>
                                                    }




                                                    </div>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>@Html.ValidationSummary(false)
                                                </td>
                                            </tr>
                                            <tr>
                                                <td align="center">
                                                    <br />
                                                    <div id="solicitudDiv" style="display: none">
                                                        <input type="hidden" id="solicitudId" name="solicitudId" />
                                                        
                                                        <table class="tituloTextNormal">
                                                            <tr>
                                                                <td>
                                                                    Solicitud:
                                                                </td>
                                                                <td>
                                                                    <b style="font-size: 14px" id="solicitudTitulo"></b>
                                                                </td>
                                                                <td>
                                                                    <a href="#" id="solicitudVerDatos" onclick="javascript:verDatosGenerales(this)">Ver Datos Generales
                                                                    </a>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td><div id="procesando1"></div>
                                                    <div id="divDatosGenerales" style="overflow: auto; width: 100%; height: 100%;" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <div id="divDatosAdicionales" style="overflow: auto; width: 100%; height: 100%; display: none">
                                                        <table cellpadding="0" border="0" cellspacing="0" width="100%">
                                                            <tr>
                                                                <td>
                                                                    <table cellpadding="0" border="0" cellspacing="0" width="100%">
                                                                        <tr>
                                                                            <td colspan="3">
                                                                                <div id="divMasDetales" xstyle="display: none;">
                                                                                    <table width="100%" cellpadding="0" border="0" cellspacing="0">
                                                                                        <tr>
                                                                                            <td>
                                                                                                <table xclass="tablaPrincipal_MIDIS" width="100%" cellpadding="0" border="0" cellspacing="0">
                                                                                                    <tbody>
                                                                                                        <tr>
                                                                                                            <td>
                                                                                                                <table cellpadding="0" cellspacing="0" border="0" width="99%">
                                                                                                                    <tr>
                                                                                                                        <td>
                                                                                                                            <table class="tablaTitulo_MIDIS" style="width: 150PX;" cellpadding="2" cellspacing="0"
                                                                                                                                border="0">
                                                                                                                                <tr>
                                                                                                                                    <td align="center">
                                                                                                                                        <div id="derivar" class="divTitulo_MIDIS" style="width: 150PX;">
                                                                                                                                            <span style="background-color: #b50055; color: white;">[DATOS ADICIONALES]</span>
                                                                                                                                        </div>
                                                                                                                                    </td>
                                                                                                                                </tr>
                                                                                                                            </table>
                                                                                                                        </td>
                                                                                                                    </tr>
                                                                                                                    <tr style="background: #D6DEEC">
                                                                                                                        <td>
                                                                                                                            <table class="tablaInterna_MIDIS" cellpadding="2" cellspacing="0" border="1" width="90%" style="background: #D6DEEC">
                                                                                                                                <tr align="left">
                                                                                                                                    <td>
                                                                                                                                        De
                                                                                                                                    </td>
                                                                                                                                    <td>
                                                                                                                                        :
                                                                                                                                    </td>
                                                                                                                                    <td align="left">
                                                                                                                                        <table cellpadding="1" cellspacing="0" border="0" width="90%" class="tituloTextNormal">
                                                                                                                                            <tr>
                                                                                                                                                <td>
                                                                                                                                                    Mesa de Parte - Sede Central
                                                                                                                                                </td>
                                                                                                                                                <td>
                                                                                                                                                    <table border="0" cellpadding="0" cellspacing="0"  class="tituloTextNormal">
                                                                                                                                                        <tr>
                                                                                                                                                            <td>
                                                                                                                                                                Para
                                                                                                                                                            </td>
                                                                                                                                                            <td>
                                                                                                                                                                :
                                                                                                                                                            </td>
                                                                                                                                                            <td>
                                                                                                                                                                @Html.DropDownListFor(m => m.nIdePara, (IEnumerable<SelectListItem>)ViewBag.ParaAtender, orienta.Utils.Constantes.SELECCIONAR, new { onchange = "javascript:onchangePara(this)" })
                                                                                                                                                            </td>
                                                                                                                                                        </tr>
                                                                                                                                                    </table>
                                                                                                                                                </td>
                                                                                                                                                <td>
                                                                                                                                                    <table border="0" cellpadding="0" cellspacing="0" style="display:none">
                                                                                                                                                        <tr>
                                                                                                                                                            <td>
                                                                                                                                                                Prioridad
                                                                                                                                                            </td>
                                                                                                                                                            <td>
                                                                                                                                                                :
                                                                                                                                                            </td>
                                                                                                                                                            <td>
                                                                                                                                                                @Html.DropDownListFor(m => m.nIdePrioridad, (IEnumerable<SelectListItem>)ViewBag.Prioridad)
                                                                                                                                                            </td>
                                                                                                                                                        </tr>
                                                                                                                                                    </table>
                                                                                                                                                </td>
                                                                                                                                            </tr>
                                                                                                                                        </table>
                                                                                                                                    </td>
                                                                                                                                </tr>
                                                                                                                                
                                                                                                                                <tr>
                                                                                                                                    <td align="left"></td>
                                                                                                                                    <td>:</td>
                                                                                                                                    <td align="left">
                                                                                                                                        <table cellpadding="0" cellspacing="0" border="0" class="tituloTextNormal">
                                                                                                                                                <tr>
                                                                                                                                                    <td>
                                                                                                                                                        Derivar
                                                                                                                                                    </td>
                                                                                                                                                    <td>
                                                                                                                                                        <input type="radio" id="idAccion" name="idAccion" checked value="1" />
                                                                                                                                                    </td>
                                                                                                                                                    <td style="width: 50px;">
                                                                                                                                                        &nbsp;
                                                                                                                                                    </td>
                                                                                                                                                    <td>
                                                                                                                                                        Registrar acci&oacute;n
                                                                                                                                                    </td>
                                                                                                                                                    <td>
                                                                                                                                                        <input type="radio" id="idAccion" name="idAccion" value="2" />
                                                                                                                                                    </td>
                                                                                                                                                </tr>
                                                                                                                                            </table>
                                                                                                                                    </td>
                                                                                                                                </tr>
                                                                                                                                <tr id="trSumilla">
                                                                                                                                    <td align="left">Sumilla/Observ.</td>
                                                                                                                                    <td>:</td>
                                                                                                                                    <td align="left">
                                                                                                                                        @Html.TextAreaFor(m => m.sSumilla, new { cols = "80", rows = "2", onkeypress = "javascript:ValidaTextarea('nuevo_derivacion','sumilla',512)", ondblclick = "javascript:limpiaCajaDobleClick(this,'1');",  onblur = "javascript:onBlurUpper(this)",onpaste = "return false" })
                                                                                                                                    </td>
                                                                                                                                </tr>
                                                                                                                                 <tr id="trAccion">
                                                                                                                                    <td align="left">Acción</td>
                                                                                                                                    <td>:</td>
                                                                                                                                    <td align="left">
                                                                                                                                        @Html.TextAreaFor(m => m.sAccion, new { cols = "80", rows = "2", onkeypress = "javascript:ValidaTextarea('nuevo_derivacion','sumilla',512)", ondblclick = "javascript:limpiaCajaDobleClick(this,'1');",  onblur = "javascript:onBlurUpper(this)",onpaste = "return false" })
                                                                                                                                    </td>
                                                                                                                                </tr>
                                                                                                                                
                                                                                                                                <tr align="left" id="trDerivarA" style="display:none">
                                                                                                                                    <td>
                                                                                                                                        Derivado A&nbsp;<span class="letraAsterisco_MIDIS">(*)</span>
                                                                                                                                    </td>
                                                                                                                                    <td>
                                                                                                                                        :
                                                                                                                                    </td>
                                                                                                                                    <td align="left">
                                                                                                                                        <table cellpadding="0" cellspacing="0" border="0">
                                                                                                                                            <tr>
                                                                                                                                                <td>
                                                                                                                                                     @Html.TextAreaFor(m => m.sDerivar, new { @class = "wickEnabledAuto", dataSrc = "dataDependencia", cols = "80", rows = "2", onkeypress1 = "javascript:ValidaTextarea('nuevo_derivacion','Accion',512)", onpaste1 = "return false" })
                                                                                                                                                </td>
                                                                                                                                                <td>
                                                                                                                                                    <table border="0" cellpadding="0" cellspacing="0">
                                                                                                                                                        <tr>
                                                                                                                                                            <td>
                                                                                                                                                                <img src="@Url.Content("~/images/personas.jpg")" class="lupita1_MIDIS" alt="VER CIE10" onclick="javascript:verFuncionarios('sDerivar');"  />
                                                                                                                                                            </td>
                                                                                                                                                            <td>
                                                                                                                                                            </td>
                                                                                                                                                        </tr>
                                                                                                                                                        <tr>
                                                                                                                                                            <td>
                                                                                                                                                                <img src="@Url.Content("~/images/copy.png")" class="lupita1_MIDIS" alt="VER CIE10" onclick="javascript:verCPT();" />
                                                                                                                                                            </td>
                                                                                                                                                            <td>
                                                                                                                                                                <img src="@Url.Content("~/images/organigrama.gif")" class="lupita1_MIDIS" alt="VER CIE10" onclick="javascript:dependencias('sDerivar')" />
                                                                                                                                                            </td>
                                                                                                                                                        </tr>
                                                                                                                                                    </table>
                                                                                                                                                </td>
                                                                                                                                            </tr>
                                                                                                                                        </table>
                                                                                                                                    </td>
                                                                                                                                </tr>
                                                                                                                                <tr id="trCC" style="display: none;" align="left">
                                                                                                                                    <td>
                                                                                                                                        Con Copia A
                                                                                                                                    </td>
                                                                                                                                    <td>
                                                                                                                                        :
                                                                                                                                    </td>
                                                                                                                                    <td>
                                                                                                                                        <table cellpadding="0" cellspacing="0" border="0">
                                                                                                                                            <tr>
                                                                                                                                                <td align="left">
                                                                                                                                                    @Html.TextAreaFor(m => m.sDerivarCC, new { @class = "wickEnabledAuto", dataSrc = "dataDependencia", cols = "80", rows = "2", onkeypress = "javascript:ValidaTextarea('nuevo_derivacion','Accion',512)", ondblclick = "javascript:limpiaCajaDobleClick(this,'1');", onpaste = "return false" })
                                                                                                                                                </td>
                                                                                                                                                <td>
                                                                                                                                                    <table border="0" cellpadding="0" cellspacing="0">
                                                                                                                                                        <tr>
                                                                                                                                                            <td>
                                                                                                                                                                <img src="@Url.Content("~/images/personas.jpg")" class="lupita1_MIDIS" alt="VER CIE10" onclick="javascript:verCPT();" />
                                                                                                                                                            </td>
                                                                                                                                                            <td>&nbsp;
                                                                                                                                                            </td>
                                                                                                                                                        </tr>
                                                                                                                                                        <tr>
                                                                                                                                                            <td>
                                                                                                                                                                <img src="@Url.Content("~/images/organigrama.gif")" class="lupita1_MIDIS" alt="VER CIE10" onclick="javascript:dependencias('sDerivarCC')" />
                                                                                                                                                            </td>
                                                                                                                                                        </tr>
                                                                                                                                                    </table>
                                                                                                                                                </td>
                                                                                                                                            </tr>
                                                                                                                                        </table>
                                                                                                                                    </td>
                                                                                                                                </tr>
                                                                                                                                <tr align="left" id="trDocumentos" style="display:none">
                                                                                                                                    <td nowrap>
                                                                                                                                        Doc. Entrante&nbsp;<span class="letraAsterisco_MIDIS">(*)</span>
                                                                                                                                    </td>
                                                                                                                                    <td>
                                                                                                                                        :
                                                                                                                                    </td>
                                                                                                                                    <td>
                                                                                                                                        <table cellpadding="0" cellspacing="0" border="0" width="95%" class="tituloTextNormal">
                                                                                                                                            <tr>
                                                                                                                                                <td>
                                                                                                                                                    <table border="0" cellpadding="0" cellspacing="0" class="tituloTextNormal">
                                                                                                                                                        <tr align="center">
                                                                                                                                                            <td colspan="2">
                                                                                                                                                                Tipo Documento
                                                                                                                                                            </td>
                                                                                                                                                            <td>
                                                                                                                                                                N&uacute;mero Documento
                                                                                                                                                            </td>
                                                                                                                                                            <td colspan="2">
                                                                                                                                                                Fecha Docum.
                                                                                                                                                            </td>
                                                                                                                                                        </tr>
                                                                                                                                                        <tr>
                                                                                                                                                            <td>
                                                                                                                                                                @Html.TextBoxFor(m => m.sTipoDocEntrante, new { @class = "wickEnabledAuto cajaTextoMayuscula", records = "1", alt = "nIdeTipoDocEntrante", autocomplete = "off", dataSrc = "dataTipoDocumento", size = "20" })
                                                                                                                                                                @Html.HiddenFor(m => m.nIdeTipoDocEntrante)
                                                                                                                                                            </td>
                                                                                                                                                            <td>
                                                                                                                                                                <img src="@Url.Content("~/images/browse.gif")" class="lupita1_MIDIS" alt="VER TIPO" titulocompendio="Tipo de documento"
                                                                                                                                                                    campollenar="sTipoDocEntrante" campohidden="nIdeTipoDocEntrante" onclick="javascript:buscaItenGeneral(this,'21');" />
                                                                                                                                                            </td>
                                                                                                                                                            <td>
                                                                                                                                                                @Html.TextBoxFor(m => m.sNroDocEntrante, new { @class = "cajaTextoMayuscula", size = "10" })
                                                                                                                                                            </td>
                                                                                                                                                            <td>
                                                                                                                                                                @Html.TextBoxFor(m => m.dtFecDocEntrante, new { @class = "cajaTextoMayuscula", @maxlength = "10", style = "width:60px", onkeyup = "javascript:MiFechaNew(this);", ondblclick = "javascript:limpiaCaja(this)" })
                                                                                                                                                            </td>
                                                                                                                                                            <td>
                                                                                                                                                                <img src="@Url.Content("~/images/fecha.jpg")" alt="MOSTRAR EL ALMANAQUE" class="lupita1_MIDIS" onclick="javascript:show_calendar(this);" />
                                                                                                                                                            </td>
                                                                                                                                                        </tr>
                                                                                                                                                    </table>
                                                                                                                                                </td>
                                                                                                                                                <td style="width: 10px;">
                                                                                                                                                    &nbsp;
                                                                                                                                                </td>
                                                                                                                                                <td xstyle="width: 160px;">
                                                                                                                                                    <table border="0" cellpadding="0" cellspacing="0"  style="display:none">
                                                                                                                                                        <tr>
                                                                                                                                                            <td align="center" colspan="2">
                                                                                                                                                                Plazo
                                                                                                                                                            </td>
                                                                                                                                                        </tr>
                                                                                                                                                        <tr>
                                                                                                                                                            <td>
                                                                                                                                                                @Html.HiddenFor(m => m.nPlazo)
                                                                                                                                                            </td>
                                                                                                                                                            <td>
                                                                                                                                                                @Html.DropDownListFor(m => m.nIdePeriodo, (IEnumerable<SelectListItem>)ViewBag.Plazo)
                                                                                                                                                            </td>
                                                                                                                                                        </tr>
                                                                                                                                                    </table>
                                                                                                                                                </td>
                                                                                                                                                <td>
                                                                                                                                                    <table border="0" cellpadding="0" cellspacing="0" class="tituloTextNormal">
                                                                                                                                                        <tr>
                                                                                                                                                            <td align="center">
                                                                                                                                                                # Folios
                                                                                                                                                            </td>
                                                                                                                                                        </tr>
                                                                                                                                                        <tr>
                                                                                                                                                            <td align="center">
                                                                                                                                                                @Html.TextBoxFor(m => m.nFolios, new { @class = "cajaTextoMayuscula", size = "3" })
                                                                                                                                                            </td>
                                                                                                                                                        </tr>
                                                                                                                                                    </table>
                                                                                                                                                </td>
                                                                                                                                                <td>
                                                                                                                                                    
                                                                                                                                                </td>
                                                                                                                                            </tr>
                                                                                                                                        </table>
                                                                                                                                    </td>
                                                                                                                                </tr>
                                                                                                                                <tr align="left" id="trReferencias" style="display:none">
                                                                                                                                    <td nowrap>
                                                                                                                                        Referencia(s)
                                                                                                                                    </td>
                                                                                                                                    <td>
                                                                                                                                        :
                                                                                                                                    </td>
                                                                                                                                    <td>
                                                                                                                                        <table id="tblReferencias">
                                                                                                                                            @foreach (var item in Model.referencias)
                                                                                                                                            {
                                                                                                                                                <tr>
                                                                                                                                                    <td>
                                                                                                                                                        <table id="tblReferencia" cellpadding="0" cellspacing="0" style="border: thin solid"
                                                                                                                                                            width="100%">
                                                                                                                                                            <tr>
                                                                                                                                                                <td>
                                                                                                                                                                    <table cellpadding="2" cellspacing="0" border="0" width="95%" class="tituloTextNormal">
                                                                                                                                                                        <tr align="center">
                                                                                                                                                                            <td>
                                                                                                                                                                                Tipo Documento
                                                                                                                                                                            </td>
                                                                                                                                                                            <td>
                                                                                                                                                                                N&uacute;mero Docum.
                                                                                                                                                                            </td>
                                                                                                                                                                            <td>
                                                                                                                                                                                Fecha Docum.
                                                                                                                                                                            </td>
                                                                                                                                                                            <td>
                                                                                                                                                                                Comentario
                                                                                                                                                                            </td>
                                                                                                                                                                            <td>
                                                                                                                                                                                &nbsp;
                                                                                                                                                                            </td>
                                                                                                                                                                        </tr>
                                                                                                                                                                        <tr align="center">
                                                                                                                                                                            <td align="left">
                                                                                                                                                                                <table border="0" cellpadding="0" cellspacing="0">
                                                                                                                                                                                    <tr>
                                                                                                                                                                                        <td>
                                                                                                                                                                                            @Html.TextBox("vTipoDocumento[]", ((orienta.ViewModels.SolicitudReferencia)item).vTipoDocumento, new { @class = "wickEnabledAuto", autocomplete = "off", dataSrc = "dataTipoDocumento", records = "1", onblur = "javascript:onblurWick(this)", size = "20" })
                                                                                                                                                                                            @Html.Hidden("nIdTipoDocumento[]", ((orienta.ViewModels.SolicitudReferencia)item).nIdTipoDocumento)
                                                                                                                                                                                        </td>
                                                                                                                                                                                        <td>
                                                                                                                                                                                            <img src="@Url.Content("~/images/browse.gif")" class="lupita1_MIDIS" alt="VER TIPO" titulocompendio="Tipo de documento"
                                                                                                                                                                                                onclick="javascript:buscaItenGeneral(this,'21');" />
                                                                                                                                                                                        </td>
                                                                                                                                                                                    </tr>
                                                                                                                                                                                </table>
                                                                                                                                                                            </td>
                                                                                                                                                                            <td>
                                                                                                                                                                                @Html.TextBox("vNroDocumento[]", ((orienta.ViewModels.SolicitudReferencia)item).vNroDocumento, new { @class = "cajaTextoMayuscula", size = "20" })
                                                                                                                                                                            </td>
                                                                                                                                                                            <td>
                                                                                                                                                                                <table cellspacing="0" cellpadding="0">
                                                                                                                                                                                    <tr>
                                                                                                                                                                                        <td>@Html.TextBox("dFecha[]", ((orienta.ViewModels.SolicitudReferencia)item).dFecha, new { @class = "cajaTextoMayuscula", size = "8" })
                                                                                                                                                                                        </td>
                                                                                                                                                                                        <td>
                                                                                                                                                                                            <img src="@Url.Content("~/images/fecha.jpg")" alt="MOSTRAR EL ALMANAQUE" class="lupita1_MIDIS" onclick="javascript:show_calendar(this);" />
                                                                                                                                                                                        </td>
                                                                                                                                                                                    </tr>
                                                                                                                                                                                </table>
                                                                                                                                                                            </td>
                                                                                                                                                                            <td>
                                                                                                                                                                                @Html.TextBox("vComentario[]", ((orienta.ViewModels.SolicitudReferencia)item).vComentario, new { @class = "cajaTextoMayuscula", size = "22" })
                                                                                                                                                                            </td>
                                                                                                                                                                        </tr>
                                                                                                                                                                        <tr>
                                                                                                                                                                            <td colspan="6">
                                                                                                                                                                                <input type="file" class="boton" style="width: 734px;" name="adjunto_tramite[]" onblur="javscript:validaCamposAdicionalesAdjunto(this);" />
                                                                                                                                                                            </td>
                                                                                                                                                                        </tr>
                                                                                                                                                                    </table>
                                                                                                                                                                </td>
                                                                                                                                                            </tr>
                                                                                                                                                        </table>
                                                                                                                                                    </td>
                                                                                                                                                    <td>
                                                                                                                                                        <table>
                                                                                                                                                            <tr>
                                                                                                                                                                <td id="tdMas">
                                                                                                                                                                    <img src="@Url.Content("~/images/mas.png")" alt="AGREGAR REFERENCIA" class="lupita1_MIDIS" onclick="javascript:addReferenciaMV(this,'tblReferencias');" />
                                                                                                                                                                </td>
                                                                                                                                                                <td id="tdBorrar" style="display: none;">
                                                                                                                                                                    <img src="@Url.Content("~/images/delete.png")" alt="MOSTRAR EL ALMANAQUE" class="lupita1_MIDIS"
                                                                                                                                                                        onclick="javascript:delReferenciaMV(this,'tblReferencias');" />
                                                                                                                                                                </td>
                                                                                                                                                            </tr>
                                                                                                                                                        </table>
                                                                                                                                                    </td>
                                                                                                                                                </tr>
                                                                                                                                            }
                                                                                                                                        </table>
                                                                                                                                    </td>
                                                                                                                                </tr>
                                                                                                                            </table>
                                                                                                                        </td>
                                                                                                                    </tr>
                                                                                                                    <tr>
                                                                                                                        <td>
                                                                                                                            &nbsp;
                                                                                                                        </td>
                                                                                                                    </tr>
                                                                                                                    <tr>
                                                                                                                        <td>
                                                                                                                            <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                                                                                                                <tbody class="letraLink_MIDIS">
                                                                                                                                    <tr align="left">
                                                                                                                                        <td>
                                                                                                                                            <b>campo obligatorio:</b>&nbsp;<span class="letraAsterisco">(*)</span>
                                                                                                                                        </td>
                                                                                                                                        <td>
                                                                                                                                            <input type="submit" class="boton" value="Registrar" />
                                                                                                                                        </td>
                                                                                                                                    </tr>
                                                                                                                                </tbody>
                                                                                                                            </table>
                                                                                                                        </td>
                                                                                                                    </tr>
                                                                                                                </table>
                                                                                                            </td>
                                                                                                        </tr>
                                                                                                    </tbody>
                                                                                                </table>
                                                                                            </td>
                                                                                        </tr>
                                                                                    </table>
                                                                                </div>
                                                                            </td>
                                                                        </tr>
                                                                    </table>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    &nbsp;
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </td>
                            </tr>
                        </table>
                    


                }
            </td>
        </tr>
    </table>
</div>
<div style="display:none">
<div id="divFuncionarios"></div>
</div>